Carbon


DoIdentifyScrapProcPtr

Header: TranslationExtensions.h Carbon status: Unsupported

Defines a pointer to a scrap identification callback function. Your scrap identification callback function identifies a scrap as one that your scrap translation extension can translate.

typedef ComponentResult(* DoIdentifyScrapProcPtr) (
    ComponentInstance self, 
    const void *dataPtr, 
    Size dataLength, 
    ScrapType *dataFormat
);

You would declare your function like this if you were to name it MyDoIdentifyScrapCallback:

ComponentResult MyDoIdentifyScrapCallback (
    ComponentInstance self, 
    const void *dataPtr, 
    Size dataLength, 
    ScrapType *dataFormat
);
Parameter descriptions
self

A component instance that identifies the component containing the translation extension.

dataPtr

A pointer to the scrap to translate.

dataLength

The size of the scrap to translate.

dataFormat

On entry, the type of the scrap format. Your function returns, through this parameter, the type of the scrap format of the scrap specified by the dataPtr parameter, as recognized by your translation extension.

In general, the scrap that your DoIdentifyScrap function is asked to identify is always in one of the formats listed among the source formats in the translation groups contained in your extension’s scrap translation list. Your scrap translation extension therefore needs only to verify that the indicated scrap is of the specified format.

function result

If successful, your function should return noErr. Otherwise, your function should return an appropriate result code. If your translation extension does not recognize the type of the specified scrap, your function should return the result code noTypeErr. The Component Manager requires this function to return a value of type ComponentResult to simplify dispatching.

DISCUSSION

A scrap translation extension must respond to the kTranslateIdentifyScrap request code. You can handle this request by calling the Component Manager function CallComponentFunctionWithStorage and passing it a pointer to a your scrap identification callback function.

CARBON NOTES

The functions contained in TranslationExtensions.h were originally written to be used only by someone implementing a Mac Easy Open translation component. Carbon, however, is for applications and not extensions. Therefore, this function is not supported.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)